#include <stdio.h>
int max(int n, int a[n]);
float avg(int n, int a[n]);
int count(int n, int a[n]);
int main(void)
{
    int n;
    printf("输入元素的个数：");
    scanf("%d", &n);
    int a[n];
    printf("一次输入每一个数：");
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i]);
    printf("最大值: %d\n", max(n, a));
    printf("平均值: %.2f\n", avg(n, a));
    printf("正元素: %d\n", count(n, a));
    return 0;
}
int max(int n, int a[n]) {
    int x = a[0];
    for (int i = 1; i < n; i++)
        if (x < a[i])
            x = a[i];
    return x;
}
float avg(int n, int a[n]) {
    int sum = 0;
    for (int i = 0; i < n; i++)
        sum += a[i];
    return (float)sum / n;
}
int count(int n, int a[n]) {
    int x = 0;
    for (int i = 0; i < n; i++)
        if (a[i] >= 0)
            x++;
    return x;
}